#include<stdio.h>
int main()
{
    int a, b, num;
    for(a = 1;a <= 9;a++)
    {
        for(b = 0;b <= 9;b++)
        {
            num = a * 1000 + 2 * 100 + b * 10 + 3;
            if(num % 23 == 0)
            {
                printf("%d ",num);
            } 
        }
    }
    return 0;
}
